﻿/* 12. Write a program that reads from the console a positive integer number N (N < 20) and outputs a matrix like the following: 
 * 
 *      1  2  3   ...   N
 *      2  3  4   ...  N+1
 *      ..................
 *      N N+1 N+2 ... 2N-1
 */

using System;

public class SquareMatrix
{
    public static void Main()
    {
        int n;

        do
        {
            Console.Clear();
            Console.Write("N = ");
            if ((int.TryParse(Console.ReadLine(), out n)) && (0 < n) && (n < 20))
                break;
        } while (true);

        Console.WriteLine();

        for (int row = 1; row <= n; row++)
        {
            for (int column = 0; column < n; column++)
            {
                Console.Write("{0,2}", row + column);
                if (column < n - 1)
                    Console.Write(" ");
            }

            Console.WriteLine();
        }

        Console.WriteLine();
    }
}